package com.ctsi.security.manager.impl;

import com.ctsi.security.domain.DataObject;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;


/**
 * 根据userLoginId、permissinId查询数据权限
 *
 * isControl()为false时,不控制数据权限
 *
 * isControl()为true时,控制数据权限
 *
 *
 * @author gbk
 *
 */
public class CacheDataObject implements java.io.Serializable {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 1032618362590627453L;
	private boolean control = true;
	private List<DataObject> dataObject = null;

	public boolean isControl() {
		return control;
	}

	public void setControl(boolean control) {
		this.control = control;
	}

	public List<DataObject> getDataObject() {
		if (dataObject==null) {
			return Collections.emptyList();
		}
		return Collections.unmodifiableList(dataObject);

	}

	public void setDataObject(List<DataObject> dataObject) {
		if (dataObject == null)
			this.dataObject = new ArrayList<DataObject>();
		else
			this.dataObject = dataObject;
	}

}
